package io.duixiangxuliehua;

import jdbc.InputUtil;

import java.util.Objects;

public class UserInfo {
    @InputUtil.InputField
    private  String userName;
    @InputUtil.InputField
    private String password;
    @InputUtil.InputField
    private int age;
    @InputUtil.InputField
    private  String  nickName;
    @InputUtil.InputField
    private  char gender;
    public UserInfo(){}
    public UserInfo(String userName,String password,int age,String nickName,char gender){
        this.userName=userName;
        this.password=password;
        this.age=age;
        this.nickName=nickName;
        this.gender=gender;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public char getGender() {
        return gender;
    }

    public void setGender(char gender) {
        this.gender = gender;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserInfo userInfo = (UserInfo) o;
        return age == userInfo.age && gender == userInfo.gender && Objects.equals(userName, userInfo.userName) && Objects.equals(password, userInfo.password) && Objects.equals(nickName, userInfo.nickName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(userName, password, age, nickName, gender);
    }

    @Override
    public String toString() {
        return "UserInfo{" +
                "userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", age=" + age +
                ", nickName='" + nickName + '\'' +
                ", gender=" + gender +
                '}';
    }
}
